package homework.homework_9.ktv;

import homework.homework_8.ktv.KTV;

import java.util.Scanner;

/**
 * @author 朱
 * @date 2019041413:19
 */
public class KTVTest {

    static Scanner scannerInt=new Scanner(System.in);
    static Scanner scannerString=new Scanner(System.in);
    static KTVDaoImp ktvDaoImp=new KTVDaoImp();
    public static void main(String[] args) {
        while(true){
            System.out.println("----kTV点歌系统----");
            System.out.println("1.点歌");
            System.out.println("2.歌曲提前");
            System.out.println("3.歌曲置顶");
            System.out.println("4.退出");
            int chese=scannerInt.nextInt();
            switch (chese){
                case 1:
                    regist() ;
                    break;
                case 2:
                    forward();
                    break;
                case 3:
                    top();
                    break;
                case 4:
                    System.out.println("欢迎下次光临！");
                    System.exit(0);
                default:
                    System.out.println("输入错误！");
                    break;
            }
        }

    }

    private static void regist() {
        System.out.println("----KTV点歌----");
        System.out.println("请输入歌曲的名称");
        String name=scannerString.nextLine();
       Ktv ktv=new Ktv(name);
       ktvDaoImp.regist(ktv);

    }

    private static void forward() {
        System.out.println("----KTV提前----");
        System.out.println("请输入歌曲的名称");
        String name=scannerString.nextLine();
        ktvDaoImp.forward(name);
    }

    private static void top() {
        System.out.println("----KTV提前----");
        System.out.println("请输入歌曲的名称");
        String name=scannerString.nextLine();
        ktvDaoImp.top(name);
    }
}
